    <div id="save-data">
    <form action="" onSubmit="return false;" id="save-form" class="ui-form">

        <ul>
            <li class="ui-widget-header">
                {$lang.$admin_page.$admin_request.pn}
            </li>
            <li>
                <label class="display-ib" for="firstname">
                    {$lang.$base_request.firstname}
                </label>
                <input type="text" name="firstname" id="firstname" value="{$pv.data.firstname}" class="required" /><span>[firstname]</span>
            </li>
            <li>
                <label class="display-ib" for="lastname">
                    {$lang.$base_request.lastname}
                </label>
                <input type="text" name="lastname" id="lastname" value="{$pv.data.lastname}" class="required" /><span>[lastname]</span>
            </li>
            <li>
                <label class="display-ib" for="companyname">
                    {$lang.$base_request.companyname}
                </label>
                <input type="text" name="companyname" id="companyname" value="{$pv.data.companyname}" class="required" /><span>[companyname]</span>
            </li>
            <li>
                <label class="display-ib" for="companyslogan">
                    {$lang.$base_request.companyslogan}
                </label>
                <input type="text" name="companyslogan" id="companyslogan" value="{$pv.data.companyslogan}" /><span>[companyslogan]</span>
            </li>
            <li>
                <label class="display-ib" for="phone">
                    {$lang.$base_request.phone}
                </label>
                <input type="text" name="phone" id="phone" value="{$pv.data.phone}" class="required" /><span>[phone]</span>
            </li>
            <li>
                <label class="display-ib" for="fax">
                    {$lang.$base_request.fax}
                </label>
                <input type="text" name="fax" id="fax" value="{$pv.data.fax}" /><span>[fax]</span>
            </li>
            <li>
                <label class="display-ib" for="address">
                    {$lang.$base_request.address}
                </label>
                <input type="text" name="address" id="address" value="{$pv.data.address}" /><span>[address]</span>
            </li>
            <li>
                <label class="display-ib" for="zip">
                    {$lang.$base_request.zip}
                </label>
                <input type="text" name="zip" id="zip" value="{$pv.data.zip}" class="required val-number" /><span>[zip]</span>
            </li>
            <li>
                <label class="display-ib" for="city">
                    {$lang.$base_request.city}
                </label>
                <input type="text" name="city" id="city" value="{$pv.data.city}" class="required" /><span>[city]</span>
            </li>
            <li>
                <label class="display-ib" for="state">
                    {$lang.$base_request.state}
                </label>
                <select name="state" id="state" class="chzn-select required">
                    {include file="_core/`$config.default_language`/states.tpl"}
                </select>
                <span>[state]</span>
            </li>
            <li>
                <label class="display-ib" for="email">
                    {$lang.$base_request.email}
                </label>
                <input type="text" name="email" id="email" value="{$pv.data.email}" class="required val-email" /><span>[email]</span>
            </li>
            <li>
                <label class="display-ib" for="logo">
                    {$lang.$base_request.logo}
                </label>
                <img src="{$config.docroot}{$pv.data.logo}" class="ui-helper-hidden" id="img-logo" alt="" />
                <button class="ui-button ui-state-default ui-corner-all trigger-imgremove" data-target="logo" id="remove-logo" style="display:none">
                    <span class="sprite-icons sprite-cancel icon-holder"></span>
                </button>
                <span>[logo]</span>
                <br/>
                <input type="hidden" id="logo" name="logo" value="{$pv.data.logo}" class="file-upload" data-filename="logo" />
            </li>
            <li class="bbottom">
                <label class="display-ib" for="logo_portal">
                    {$lang.$base_request.logo_portal}
                </label>
                <img src="{$config.docroot}{$pv.data.logo_portal}" class="ui-helper-hidden" id="img-logo_portal" />
                <button class="ui-button ui-state-default ui-corner-all trigger-imgremove" data-target="logo_portal" id="remove-logo_portal" style="display:none">
                    <span class="sprite-icons sprite-cancel icon-holder"></span>
                </button>
                <span>[logo_portal]</span>
                <br/>
                <input type="hidden" id="logo_portal" class="file-upload" name="logo_portal" value="{$pv.data.logo_portal}" data-filename="logo_portal" />
            </li>
            <li class="borderless">
                <label class="display-ib borderless">
                </label>
                <button class="ui-button ui-state-default ui-corner-all form-trigger" data-action="save" data-request="{$base_request}" data-formid="save-form">
                    <span class="sprite-icons sprite-save_on icon-holder"></span>
                    <span>{$lang.forms.save}</span>
                </button>
            </li>
        </ul>


    </form>
    
</div>    
{capture "$admin_request"}
$('#state').val("{$pv.data.state}").trigger("liszt:updated");
_sid ='{$user.session_id}';

{if $pv.data.logo neq ""}
$('#save-data #img-logo').removeClass('ui-helper-hidden');
$('#save-data #remove-logo').show();
{/if}

{if $pv.data.logo_portal neq ""}
$('#save-data #img-logo_portal').removeClass('ui-helper-hidden');
$('#save-data #remove-logo_portal').show();
{/if}

{literal}
$('.file-upload').each(function () {
	var _this = $(this);
	var _target = _this.data('target');
	var _id = _this.attr('id');
	var _filename = _this.data('filename');
	var _params = _this.data('params');
	_this.uploadify({
		'uploader': _templatePath + 'images/uploadify/uploadify.swf',
		'cancelImg': _templatePath + 'images/uploadify/cancel.png',
		'script': _docroot + 'admin/fileupload/index.html' + _ajax,
		'folder': '/',
		'multi': false,
		'displayData': 'perc-speed',
		'removeCompleted': false,
		'auto': true,
		'buttonText': 'Select File',
		onSelectOnce: function (event, ID, fileObj) {
			$('#img_' + _id).addClass('ui-helper-hidden');
			_this.uploadifySettings('scriptData', {
				"resize": "1",
				"path": "",
				"subpath": "",
				"filename": _filename,
				"params": _params,
				"sid": _sid
			});
		},
		onComplete: function (event, ID, fileObj, response, data) {
			var json = $.parseJSON(response);
			if (json.error == 0) {
				$('#img-' + _id).prop('src', json.message + '?' + Math.round((new Date()).getTime() / 1000)).removeClass('ui-helper-hidden');
				_this.val(json.message);
				$('#save-data #remove-' + _id).show();
				console.log(json);
			} else {
				console.log("@Todo modal error");
			}
		}
	});
});
{/literal}
{/capture}
